import http from '@/utils/request'

/**
 * 用户登录
 */
export const loginApi = (data) => {
  return http.post('/user/login', data)
}

/**
 * 用户登出
 */
export const logoutApi = () => {
  return http.post('/user/logout')
}

/**
 * 获取用户信息
 */
export const getUserInfoApi = () => {
  return http.get('/user/info')
}

/**
 * 获取验证码
 */
export const getCaptchaApi = () => {
  return http.get('/captcha', {}, { responseType: 'blob' })
}

/**
 * 刷新Token
 */
export const refreshTokenApi = (refreshToken) => {
  return http.post('/user/refresh-token', { refreshToken })
} 